import { createRouter, createWebHashHistory, createWebHistory } from "vue-router";

const router = createRouter({
    history: createWebHistory(),
    routes:[
        {
            path: '/',
            name: 'Main',
            component: () => import("../views/MainView.vue"),
            redirect: '/index',
            children: [
                {
                    path: '/index',
                    name: 'Index',
                    component: () => import("../views/index/IndexView.vue")
                },
                {
                    path: '/commodity',
                    name: 'Commodity',
                    component: () => import("../views/commodity/CommodityView.vue")
                },
                {
                    path: '/search',
                    name: 'Search',
                    component: () => import("../views/search/SearchView.vue")
                },
                {
                    path: '/shoppingCart',
                    name: 'ShoppingCart',
                    component: () => import("../views/shoppingCart/ShoppingCartView.vue")
                },
                {
                    path: '/cost',
                    name: 'Cost',
                    component: () => import("../views/cost/cost.vue")
                }
            ]
        }
    ]
})

export default router;
